home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.amiga.programmer
- Path: nntp.coast.net!torn!utnut!utgpu!normb
- From: normb@gpu.utcc.utoronto.ca (Norman Baccari)
- Subject: Problems With LoadSeg()
- Message-ID: <DMF0vK.LI0@gpu.utcc.utoronto.ca>
- Organization: UTCC Public Access
- Distribution: Earth
- Date: Wed, 7 Feb 1996 17:06:56 GMT
-
-
- Im trying to find the best way to read in a libraries
- IdString. I've tried OpenLibrary() but this has some
- undesireable side effects. Im now trying to use LoadSeg()
- but this too seems to have some unusual problems. Maybe
- someone can shed some light on this for me. If I LoadSeg()
- a library and look at the resident structures rt_IdString,
- on certain libraries the first 4 bytes of the IdString
- contain \0\4\251\128. Strlen() obviously thinks the string
- is 0 bytes long because of the zero in position 0 but the
- IdString follows right after \128. Using OpenLibrary() on
- the same lib will give me the IdString as it should be. I
- also get enforcer hits reading certain IdStrings even though
- the string is properly terminated. I appreciate any help on
- this...
-
- ------------------------------------------------------------
- void MyLoadSeg(char *LibName)
- {
- BPTR LibSeg;
- struct Resident *ResLib;
- char Buffer[128];
-
- if(LibSeg=LoadSeg(LibName))
- {
- ResLib=(struct Resident *)((LONG *)BADDR(LibSeg)+2);
- strcpy(Buffer,ResLib->rt_IdString);
- printf("strlen(%d) \n",strlen(Buffer));
- printf("%s\n",Buffer);
- UnLoadSeg(LibSeg);
- }
- }
-
- -------------------------------------------------------------------
- Norman Baccari | "OK team! You start coding.
- normb@gpu.utcc.utoronto.ca | I'll go see what the user specs are."
- Toronto,Ontario,Canada |
- -------------------------------------------------------------------
-